package com.action;


import com.pojo.UserinfoPOJO;
import com.service.UserinfoService;
import com.vo.ResponseBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.security.NoSuchAlgorithmException;

@RestController
@RequestMapping("/user")
@CrossOrigin("*")
public class UserinfoAction {

    @Autowired
    private UserinfoService userinfoService;

    /**
     * 用户登录
     * @param user 用户名
     * @param pwd 密码
     * @return
     */


    @RequestMapping("/login")
    public ResponseBean login(String user,String pwd) throws NoSuchAlgorithmException {
        //
        UserinfoPOJO userinfoPOJO = userinfoService.login(user,pwd);
        if (userinfoPOJO != null){
            return new ResponseBean(200, 0, "操作成功");
        }
        return new ResponseBean(500, 0, "操作失败");

    }


}

